home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ablood1a / form1.frm next >
Text File  |  1998-10-11  |  4KB  |  166 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   4440
  7.    ClientLeft      =   0
  8.    ClientTop       =   0
  9.    ClientWidth     =   6525
  10.    DrawWidth       =   15
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4440
  13.    ScaleWidth      =   6525
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   3  'Windows Default
  16.    WindowState     =   2  'Maximized
  17. End
  18. Attribute VB_Name = "Form1"
  19. Attribute VB_GlobalNameSpace = False
  20. Attribute VB_Creatable = False
  21. Attribute VB_PredeclaredId = True
  22. Attribute VB_Exposed = False
  23. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  24. 'Blood Shot Screen Saver v1.0
  25. 'Author: Dustin Davis
  26. 'Bootleg Software Inc.
  27. 'http://www.warpnet.org/bsi
  28. '
  29. 'This program and its code was ALL, and I mean EVERY LINE was written from
  30. 'scratch by me. If someone else has done something like this, I have not seen it
  31. 'and that is why i made this one! It is not set up to be in screen saver
  32. 'format yet, but all it takes is a few adjustments. Feel free to edit it
  33. 'to your taste. Yes, I know its kind of cheesy, but hey, i was bored!
  34. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  35.  
  36. Dim bSize As Long
  37. Dim Counter As Integer
  38. Dim sound As Boolean
  39. Dim X As Long
  40. Dim Y As Long
  41. Dim Go As Boolean
  42.  
  43. Private Sub Form_Activate()
  44. 'starts the show!
  45. Call Blood_Stream
  46. End Sub
  47.  
  48. Private Sub Form_Click()
  49. Go = False 'exits
  50. End Sub
  51.  
  52. Public Sub Blood_Stream()
  53. 'draws the blood stream
  54. Dim i As Long
  55. Dim j As Long
  56. Randomize
  57. i = 3
  58. j = 3
  59. Go = True
  60. X = 0
  61. Y = 0
  62. Do
  63.     Randomize
  64.     check_border 'check to see if a new shot should be fired!
  65.     DoEvents
  66.     i = (Rnd * 3)
  67.     If i = 1 Then
  68.         Y = (Y - (i * 4))
  69.         PSet (X, Y), RGB(250, 0, 0)
  70.     ElseIf i = 2 Then
  71.         Y = (Y + (i * 4))
  72.         PSet (X, Y), RGB(250, 0, 0)
  73.     Else
  74.         PSet (X, Y), RGB(240, 4, 4) 'this gives it a more realistic look
  75.     End If
  76.     Randomize
  77.     DoEvents
  78.     j = (Rnd * 3)
  79.     If j = 1 Then
  80.         X = (X + (i * 4))
  81.         PSet (X, Y), RGB(250, 0, 0)
  82.     ElseIf j = 2 Then
  83.         X = (X - (i * 4))
  84.         PSet (X, Y), RGB(250, 0, 0)
  85.     Else
  86.         PSet (X, Y), RGB(240, 4, 4) 'this gives it a more realistic look
  87.     End If
  88.     
  89. Randomize
  90. Loop Until Go = False
  91. Unload Me
  92. End Sub
  93.  
  94. Public Sub check_border()
  95. 'this is important. If the blood stream has reached the bootom of the screen, then
  96. 'shot the screen again!
  97. Dim clear As Integer
  98. clear = GetSetting("blood", "settings", "clear", "10")
  99. If X <= 0 Then
  100.         X = (Rnd * Form1.Width)
  101.         Y = (Rnd * Form1.Height)
  102.         
  103.         If Counter = clear Then
  104.             Form1.Cls
  105.             Counter = 0
  106.         Else
  107.             Counter = Counter + 1
  108.         End If
  109.         If sound = True Then
  110.             playwav "gun.wav"
  111.         End If
  112.     ElseIf X >= Form1.Width Then
  113.         X = (Rnd * Form1.Width)
  114.         Y = (Rnd * Form1.Height)
  115.        
  116.        If Counter = clear Then
  117.             Form1.Cls
  118.             Counter = 0
  119.         Else
  120.             Counter = Counter + 1
  121.         End If
  122.         If sound = True Then
  123.             playwav "gun.wav"
  124.         End If
  125.     ElseIf Y <= 0 Then
  126.         X = (Rnd * Form1.Width)
  127.         Y = (Rnd * Form1.Height)
  128.         
  129.         If Counter = clear Then
  130.             Form1.Cls
  131.             Counter = 0
  132.         Else
  133.             Counter = Counter + 1
  134.         End If
  135.         If sound = True Then
  136.             playwav "gun.wav"
  137.         End If
  138.     ElseIf Y >= Form1.Height Then
  139.         X = (Rnd * Form1.Width)
  140.         Y = (Rnd * Form1.Height)
  141.         
  142.         If Counter = clear Then
  143.             Form1.Cls
  144.             Counter = 0
  145.         Else
  146.             Counter = Counter + 1
  147.         End If
  148.         
  149.         If sound = True Then
  150.             playwav "gun.wav"
  151.         End If
  152.     End If
  153. End Sub
  154.  
  155. Private Sub Form_DblClick()
  156. Form2.Visible = True 'show settings
  157. End Sub
  158.  
  159. Private Sub Form_Load()
  160. 'load all the settings
  161. sound = GetSetting("blood", "settings", "sound", "true")
  162. size = GetSetting("blood", "settings", "size", "20")
  163. Form1.DrawWidth = size 'sets the size of the blood stream
  164. Counter = 0
  165. End Sub
  166.